#ifndef XMLHANDLER_H
#define XMLHANDLER_H

#include <QMap>
#include <QXmlDefaultHandler>

const QString entry_tag = "entry";
const QString user_name_tag = "title";
const QString user_email_tag = "email";
const QString user_email_attr = "address";

class xmlHandler : public QXmlDefaultHandler
{
public:
    xmlHandler(QMap<QString, QString>& _contacts);
    bool startElement(const QString & namespaceURI,
                       const QString & localName,
                       const QString & qName,
                       const QXmlAttributes & atts );
    bool endElement(const QString & namespaceURI,
                     const QString & localName,
                     const QString & qName);
    bool characters(const QString & ch);
private:
    bool entry;
    bool title;
    QString username;
    QMap<QString, QString>& contacts;
};

#endif // XMLHANDLER_H
